<template>
  <view>
    <el-table @row-click="clickRow" ref="refTable" :data="fileds" @selection-change="handleSelectionChange" height="500px">
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column prop="向量名称" align="center" label="向量名称" width="220">
        <template #default="scope">
          <el-link :underline="false" @click="onClick(scope.row)">{{ scope.row }}</el-link>
        </template>
      </el-table-column>
    </el-table>
  </view>
</template>

<script setup>
import { onMounted, defineProps } from "vue";
const emit = defineEmits(["confirm", "selectedFileds"]);
const { proxy } = getCurrentInstance();
const props = defineProps({
  id:{
    type:String,
  },
  fileds: {
    type: Array,
  },
  selectedFileds: {
    type: Array,
  },
});
// 多选框选中数据
function handleSelectionChange(selection) {
  //proxy.$refs["refTable"].clearSelection();
  var list = selection.map((item) => item);
  emit("update:selectedFileds", list);
}
</script>
